package com.xiaot.shopping.product.entity;

import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.xiaot.shopping.product.annotation.ListValue;
import com.xiaot.shopping.product.valid.SaveValid;
import com.xiaot.shopping.product.valid.UpdateValid;
import lombok.Data;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.io.Serializable;

/**
 * 品牌
 * 
 * @author xiaoT
 * @email 
 * @date 2021-07-02 22:36:20
 */
@Data
@TableName("pms_brand")
public class BrandEntity implements Serializable {
	private static final long serialVersionUID = 1L;

	/**
	 * 品牌id
	 */
	@TableId
	private Long brandId;
	/**
	 * 品牌名
	 */
	@NotBlank(message = "品牌名不能为空", groups = {SaveValid.class})
	private String name;
	/**
	 * 品牌logo地址
	 */
	private String logo;
	/**
	 * 介绍
	 */
	private String descript;
	/**
	 * 显示状态[0-不显示；1-显示]
	 */
	@ListValue(vals = {0, 1}, groups = {SaveValid.class, UpdateValid.class})
	private Integer showStatus;
	/**
	 * 检索首字母
	 */
	@NotBlank(message = "首字母不能为空", groups = {SaveValid.class})
	@Pattern(regexp = "^[a-zA-Z]$", message = "首字母输入a-z或A-Z")
	private String firstLetter;
	/**
	 * 排序
	 */
	@NotNull(message = "不能小于0", groups = {SaveValid.class})
	@Min(0)
	private Integer sort;

}
